<div class="tit p-lr20">
    <a class="c-40d064" href="javascript:;">题库管理</a><em class="p-lr10 c-CCCCCC fs12">/</em><em>添加题目</em>
</div>
<!--star内容区域-->
<div class="mainScroll">
    <div class="mainContainer line-all">
    	<!--star 001-->
        <div class="form-horizontal">
			<div class="filter-groups">
                	<!--star 我基本上不变-->
                    <div class="control-group fix">
                        <div class="l">
                            <label class="control-label">科目：</label>
                            <div class="controls">
                                <select class="text">
                                    <option>会计基础</option>
                                    <option>财经法规与会计职业道德</option>
                                    <option>会计电算化</option>
                                    <option>经济法基础</option>
                                    <option>初级会计实务</option>
                                </select>
                            </div>
                        </div>
                        <div class="l">
                            <label class="control-label">章节：</label>
                            <div class="controls chapter-selector">
                        		<span class="chaptext text" type="text" onclick="jsChapterSelector(this);"><span class="dataGid" datagid=''></span> <span class="dataDid" datadid=''></span><span>请选择章节</span></span>
                                
                            </div>
                        </div>
                    </div>
                    <div class="control-group fix">
                        <div class="l">
                            <label class="control-label">题型：</label>
                            <div class="controls">
                                <select class="text" id="questionType">
                                    <option value="s">单选题</option>
                                    <option value="m">多选题</option>
                                    <option value="j">判断题</option>
                                    <option value="e">计算分析题</option>
                                </select>
                            </div>
                        </div>
                        <div class="l">
                            <label class="control-label">难度：</label>
                            <div class="controls">
                                <select class="text">
                                    <option>易</option>
                                    <option>中</option>
                                    <option>难</option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="control-group fix">
                   		<label class="control-label">主题干：</label>
                        <div class="controls">
                       	  <div class="summernote"></div>
                        </div>
                    </div>
                    <!--end 我基本上不变-->
              		<!--star 灵活的-->
                    <div id="optionSetWrap">
                    	<!--star 单选-->
                    	<div class="question-option radiolist" questiontype="s">
                            <div class="control-group fix">
                                <label class="control-label">选项 A</label>
                                <div class="controls question-option">
                                    <input class="acc-form-control l" style="width:70%;" value="" data-letter="A" type="text">
                                    <div class="select-right-ans l">
                                        <input name='question-type-s' type="radio" value='A' /><label><span class="ico_radio"></span>正确答案 </label>
                                    </div>
                                </div>
                            </div>
                            <div class="control-group fix">
                                <label class="control-label">选项 B</label>
                                <div class="controls question-option">
                                    <input class="acc-form-control l" style="width:70%;" value="" data-letter="B" type="text">
                                    <div class="select-right-ans l">
                                        <input name='question-type-s' type="radio" value='B' /><label><span class="ico_radio"></span>正确答案 </label>
                                    </div>
                                </div>
                            </div>
                            <div class="control-group fix">
                                <label class="control-label">选项 C</label>
                                <div class="controls question-option">
                                    <input class="acc-form-control l" style="width:70%;" value="" data-letter="C" type="text">
                                    <div class="select-right-ans l">
                                        <input name='question-type-s' type="radio" value='C' /><label><span class="ico_radio"></span>正确答案 </label>
                                    </div>
                                </div>
                            </div>
                            <div class="control-group fix">
                                <label class="control-label">选项 D</label>
                                <div class="controls question-option">
                                    <input class="acc-form-control l" style="width:70%;" value="" data-letter="D" type="text">
                                    <div class="select-right-ans l">
                                        <input name='question-type-s' type="radio" value='D' /><label><span class="ico_radio"></span>正确答案 </label>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!--end 单选-->
                    	<!--star 多选-->
                    	<div class="question-option chklist" questiontype="m" style="display:none;">
                            <div class="control-group fix">
                                <label class="control-label">选项 A</label>
                                <div class="controls question-option">
                                    <input class="acc-form-control l" style="width:70%;" value="" data-letter="A" type="text">
                                    <div class="select-right-ans l">
                                        <input name='question-type-s' type="checkbox" value='A' /><label><span class="ico_check"></span>正确答案 </label>
                                    </div>
                                </div>
                            </div>
                            <div class="control-group fix">
                                <label class="control-label">选项 B</label>
                                <div class="controls question-option">
                                    <input class="acc-form-control l" style="width:70%;" value="" data-letter="B" type="text">
                                    <div class="select-right-ans l">
                                        <input name='question-type-s' type="checkbox" value='B' /><label><span class="ico_check"></span>正确答案 </label>
                                    </div>
                                </div>
                            </div>
                            <div class="control-group fix">
                                <label class="control-label">选项 C</label>
                                <div class="controls question-option">
                                    <input class="acc-form-control l" style="width:70%;" value="" data-letter="C" type="text">
                                    <div class="select-right-ans l">
                                        <input name='question-type-s' type="checkbox" value='C' /><label><span class="ico_check"></span>正确答案 </label>
                                    </div>
                                </div>
                            </div>
                            <div class="control-group fix">
                                <label class="control-label">选项 D</label>
                                <div class="controls question-option">
                                    <input class="acc-form-control l" style="width:70%;" value="" data-letter="D" type="text">
                                    <div class="select-right-ans l">
                                        <input name='question-type-s' type="checkbox" value='D' /><label><span class="ico_check"></span>正确答案 </label>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!--end 多选-->
                    	<!--star 判断题-->
                    	<div class="question-option radiolist" questiontype="j" style="display:none;">
                            <div class="control-group fix">
                                <label class="control-label">选项</label>
                                <div class="controls question-option">
                                    <input class="acc-form-control l" style="width:70%;" value="对" readonly="" data-letter="A" type="text">
                                    <div class="select-right-ans l">
                                        <input name='question-type-s' type="radio" value='A' /><label><span class="ico_radio"></span>正确答案 </label>
                                    </div>
                                </div>
                            </div>
                            <div class="control-group fix">
                                <label class="control-label">选项</label>
                                <div class="controls question-option">
                                    <input class="acc-form-control l" style="width:70%;" value="错" readonly="" data-letter="B" type="text">
                                    <div class="select-right-ans l">
                                        <input name='question-type-s' type="radio" value='B' /><label><span class="ico_radio"></span>正确答案 </label>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!--end 判断题-->
                    	<!--star 计算分析题-->
                    	<div class="question-option" questiontype="e" style="display:none;">
                        	<div class="tab-class-timu">
                                <span>第一题</span>
                                <span>第二题</span>
                                <span>第三题</span>
                                <span>第四题</span>
                                <span>第五题</span>
                            </div>
                            <div class="tab-class-item">
                            	<!--star 第一题-->
                                <div class="question-small-item">
                                    <div class="control-group fix">
                                        <label class="control-label">子类型</label>
                                        <div class="controls question-option">
                                        	<div class="radio-ilbk p-t5">
                                                <span class="radio-type-item" datatype="a1"><input name='question-type-s' type="radio" value='A' checked /><label class="hRadio_Checked"><span class="ico_radio"></span>填空题</label></span>
                                                <span class="radio-type-item" datatype="a2"><input name='question-type-s' type="radio" value='B' /><label><span class="ico_radio"></span>分录题</label></span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="control-group fix">
                                        <label class="control-label">子题干</label>
                                        <div class="controls question-option">
                                        	<div class="p-t5">
                                        	<textarea style="width:100%;" rows="5"></textarea>
                                            </div>
                                        </div>
                                    </div>
                                    <!--star 答案选择有子项-->
                                    <div class="question-small-item-item">
                                        <!--star 填空题-->
                                    	<div class="control-group fix" questiontype="a1">
                                            <label class="control-label">答案</label>
                                            <div class="controls question-option">
                                                <div class="p-t5">
                                                <input style="width:50%;" class="text" type="text">
                                                </div>
                                            </div>
                                        </div>
                                        <!--end 填空题-->
                                        <!--star 分录题多个答案-->
                                    	<div class="control-group fix" questiontype="a2" style="display:none;">
                                        	<div class="detailAnswer">
                                            	<!--star001-->
                                            	<div class="control-group fix">
                                                	<label class="control-label">答案</label>
                                                    <div class="controls p-t5">
                                                        <select class="text">
                                                            <option selected="">请选择记账方向</option>
                                                            <option value="借">借</option>
                                                            <option value="贷">贷</option>
                                                        </select>
                                                        <select class="text">
                                                            <option selected="">请选择科目明细</option>
                                                            <option value="资产类">资产类</option>
                                                            <option value="负债类">负债类</option>
                                                        </select>
                                                        <input class="text m-r10" type="text" style="width:300px;">
                                                    </div>
                                                </div>
                                                <!--end001-->
                                            	<!--star002-->
                                            	<div class="control-group fix">
                                                	<label class="control-label">答案</label>
                                                    <div class="controls p-t5">
                                                        <select class="text">
                                                            <option selected="">请选择记账方向</option>
                                                            <option value="借">借</option>
                                                            <option value="贷">贷</option>
                                                        </select>
                                                        <select class="text">
                                                            <option selected="">请选择科目明细</option>
                                                            <option value="资产类">资产类</option>
                                                            <option value="负债类">负债类</option>
                                                        </select>
                                                        <input class="text m-r10" type="text" style="width:300px;">
                                                    </div>
                                                </div>
                                                <!--end002-->
                                                <div class="addItem-btn tac p-t10 fix">
                                                	<button class="zent-btn zent-btn-primary" onclick="jsAddItem(this);">新增答案项</button>
                                                </div>
                                            </div>
                                        </div>
                                        <!--end 分录题多个答案-->
                                    </div>
                                    <!--end 答案选择有子项-->
                                </div>
                            	<!--end 第一题-->
                                <div class="question-small-item">
                                    2同第一题
                                </div>
                                <div class="question-small-item">
                                    3同第一题
                                </div>
                                <div class="question-small-item">
                                    4同第一题
                                </div>
                                <div class="question-small-item">
                                    5同第一题
                                </div>
                            </div>
                            
                        </div>
                        <!--end 计算分析题-->
                    </div>
                    <!--end 灵活的-->
                    <!--star 我基本上不变-->
                    <div class="subject-form fix m-t20">
                    	<div class="dot-line m-tb20" style="width:100%"></div>
                        <div class="control-group fix">
                            <label class="control-label">答案解析：</label>
                            <div class="controls">
                                <div class="summernote"></div>
                            </div>
                        </div>
                        <div class="control-group fix">
                            <label class="control-label"></label>
                            <div class="controls">
                                <button class="zent-btn zent-btn-primary">保存并继续添加</button>
                                <button class="zent-btn zent-btn-primary">保存</button>
                            </div>
                        </div>
                    </div>
                    <!--end 我基本上不变-->
                    
			</div>
        </div>
		<!--end 001-->
        
    </div>
    
</div>
<!--end内容区域-->

<!--<link href="http://www.jq22.com/jquery/bootstrap-3.3.4.css" rel="stylesheet">
<script src="http://libs.baidu.com/jquery/2.1.1/jquery.min.jss"></script>-->
<link href="lib/css/bootstrap.css" rel="stylesheet">
<script src="lib/js/bootstrap.min.js" type="text/javascript"></script>
<link href="lib/summernote/summernote.css" rel="stylesheet">
<script src="lib/summernote/summernote.js"></script>
<script>
var html_control='';

function data_val(thiss,nameVal,type){
	$(thiss).attr(type,function(){
		var attr = $(this).attr(type);
		if(attr == nameVal){
			$(this).show().siblings().hide();
		}
	})
};

function jsAddItem(){
	$('.detailAnswer').find('.addItem-btn').before(html_control);	
};

function jsRemoveType(objthis){
	$this = $(objthis);
	$this.parent('.controls').parent('.control-group').remove();
}

$(function() {
	html_control = '<div class="control-group fix">'+
			'<label class="control-label">答案</label>'+
			'<div class="controls p-t5">'+
				'<select class="text">'+
					'<option selected="">请选择记账方向</option><option value="借">借</option><option value="贷">贷</option>'+
				'</select> '+
				'<select class="text">'+
					'<option selected="">请选择科目明细</option><option value="资产类">资产类</option><option value="负债类">负债类</option>'+
				'</select> '+
				'<input class="text m-r10" type="text" style="width:300px;">'+
				'<span class="remove-type-btn u1" onclick="jsRemoveType(this)"><span class="r_ico"></span></span>'+
			'</div>'+
		'</div>';
	//
	
	$('.summernote').summernote();
	$('.chklist').hcheckbox();
	$('.radiolist').divhradio('.control-group');
	$('.radio-ilbk').divhradio('span.radio-type-item');
	//
	//提醒选择判断
	$('#questionType').find('option').each(function(){
		$(this).click(function(){
			var post = $('#optionSetWrap').find('.question-option');
			type = 'questiontype';
			thiss = post;
			if($(this).val() == 's'){
				data_val(thiss,'s',type)
			}
			if($(this).val() == 'm'){
				data_val(thiss,'m',type)
			}
			if($(this).val() == 'j'){
				data_val(thiss,'j',type)
			}
			if($(this).val() == 'e'){
				data_val(thiss,'e',type)
			}
		})
	});
	//5大题目切换
	$.fn.Dashentab(".tab-class-timu","span",".tab-class-item",".question-small-item","active","click",0);
	//填空题与分录题切换
	$('.radio-ilbk').find('span.radio-type-item .hRadio').each(function(){
		$(this).click(function(){
			var post = $('.question-small-item-item').find('.control-group');
			type = 'questiontype';
			thiss = post;
			if($(this).parent('.radio-type-item').attr('datatype') == 'a1'){
				data_val(thiss,'a1',type)
			}
			if($(this).parent('.radio-type-item').attr('datatype') == 'a2'){
				data_val(thiss,'a2',type)
			}
		});
	});
});
</script>
